<?php
class Persona extends AppModel {

	var $name = 'Persona';
	var $displayField = 'identificacion';

	
	var $validate = array(
		'empresa_id' => array('numeric'),
		'identificacion_tipo' => array('numeric'),
		'paterno' => array('notempty'),
		'nombres' => array('notempty'),
		'estado_civil_tipo' => array('numeric'),
		'sexo_tipo' => array('numeric'),
		'nacionalidad_tipo' => array('numeric'),
		'prevision_id' => array('numeric'),
		'actividad_tipo' => array('numeric'),
		'vigencia' => array('numeric'),
		'usuario' => array('numeric')
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $belongsTo = array(
		'Empresa' => array(
			'className' => 'Empresa',
			'foreignKey' => 'empresa_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Prevision' => array(
			'className' => 'Prevision',
			'foreignKey' => 'prevision_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Tipo' => array(
			'className' => 'Tipo',
			'foreignKey' => 'identificacion_tipo',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	/*var $hasOne = array(
		'Contacto' => array(
			'className' => 'Contacto',
			'foreignKey' => 'persona_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);*/

	var $hasMany = array(
		'Contacto' => array(
			'className' => 'Contacto',
			'foreignKey' => 'persona_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'Direccion' => array(
			'className' => 'Direccion',
			'foreignKey' => 'persona_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

}
?>
